package com.yh.manage.course.controller;

import com.lxw.api.course.TeachplanControllerApi;
import com.lxw.framework.domain.course.Teachplan;
import com.lxw.framework.domain.course.ext.TeachplanNode;
import com.lxw.framework.model.response.ResponseResult;
import com.yh.manage.course.service.TeachplanService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("course")
public class TeachplanController implements TeachplanControllerApi {

    @Resource
    private TeachplanService teachplanService;

    @Override
    @GetMapping("/teachplan/list/{courseId}")
    public TeachplanNode findTeachplanNodes(@PathVariable String courseId) {
        return teachplanService.findTeachplanList(courseId);
    }

    @Override
    @PostMapping("/teachplan/add")
    public ResponseResult addTeachplan(@RequestBody Teachplan teachplan) {
        return teachplanService.addTeachplan(teachplan);
    }
}
